3.809 \(\int \frac{(f+g x)^n \left (a+2 c d x+c e x^2\right )}{d+e x} \, dx\)

Optimal. Leaf size=114 \[ \frac{\left (c d^2-a e\right ) (f+g x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{e (f+g x)}{e f-d g}\right )}{e (n+1) (e f-d g)}-\frac{c (e f-d g) (f+g x)^{n+1}}{e g^2 (n+1)}+\frac{c (f+g x)^{n+2}}{g^2 (n+2)} \]

[Out]

-((c*(e*f - d*g)*(f + g*x)^(1 + n))/(e*g^2*(1 + n))) + (c*(f + g*x)^(2 + n))/(g^
2*(2 + n)) + ((c*d^2 - a*e)*(f + g*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n,
 (e*(f + g*x))/(e*f - d*g)])/(e*(e*f - d*g)*(1 + n))

_______________________________________________________________________________________

Rubi [A]  time = 0.302347, antiderivative size = 114, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.107 \[ \frac{\left (c d^2-a e\right ) (f+g x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{e (f+g x)}{e f-d g}\right )}{e (n+1) (e f-d g)}-\frac{c (e f-d g) (f+g x)^{n+1}}{e g^2 (n+1)}+\frac{c (f+g x)^{n+2}}{g^2 (n+2)} \]

Antiderivative was successfully verified.

[In]  Int[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x),x]

[Out]

-((c*(e*f - d*g)*(f + g*x)^(1 + n))/(e*g^2*(1 + n))) + (c*(f + g*x)^(2 + n))/(g^
2*(2 + n)) + ((c*d^2 - a*e)*(f + g*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n,
 (e*(f + g*x))/(e*f - d*g)])/(e*(e*f - d*g)*(1 + n))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 35.3139, size = 90, normalized size = 0.79 \[ \frac{c \left (f + g x\right )^{n + 2}}{g^{2} \left (n + 2\right )} + \frac{c \left (f + g x\right )^{n + 1} \left (d g - e f\right )}{e g^{2} \left (n + 1\right )} + \frac{\left (f + g x\right )^{n + 1} \left (a e - c d^{2}\right ){{}_{2}F_{1}\left (\begin{matrix} 1, n + 1 \\ n + 2 \end{matrix}\middle |{\frac{e \left (- f - g x\right )}{d g - e f}} \right )}}{e \left (n + 1\right ) \left (d g - e f\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((g*x+f)**n*(c*e*x**2+2*c*d*x+a)/(e*x+d),x)

[Out]

c*(f + g*x)**(n + 2)/(g**2*(n + 2)) + c*(f + g*x)**(n + 1)*(d*g - e*f)/(e*g**2*(
n + 1)) + (f + g*x)**(n + 1)*(a*e - c*d**2)*hyper((1, n + 1), (n + 2,), e*(-f -
g*x)/(d*g - e*f))/(e*(n + 1)*(d*g - e*f))

_______________________________________________________________________________________

Mathematica [A]  time = 0.557975, size = 125, normalized size = 1.1 \[ \frac{(f+g x)^n \left (\frac{(f+g x) \left (c d^2-a e\right ) \, _2F_1\left (1,n+1;n+2;\frac{e (f+g x)}{e f-d g}\right )}{e (e f-d g)}+\frac{c \left (\frac{d g (f+g x)}{e}+\frac{f^2 \left (\left (\frac{g x}{f}+1\right )^{-n}-1\right )+f g n x+g^2 (n+1) x^2}{n+2}\right )}{g^2}\right )}{n+1} \]

Antiderivative was successfully verified.

[In]  Integrate[((f + g*x)^n*(a + 2*c*d*x + c*e*x^2))/(d + e*x),x]

[Out]

((f + g*x)^n*((c*((d*g*(f + g*x))/e + (f*g*n*x + g^2*(1 + n)*x^2 + f^2*(-1 + (1
+ (g*x)/f)^(-n)))/(2 + n)))/g^2 + ((c*d^2 - a*e)*(f + g*x)*Hypergeometric2F1[1,
1 + n, 2 + n, (e*(f + g*x))/(e*f - d*g)])/(e*(e*f - d*g))))/(1 + n)

_______________________________________________________________________________________

Maple [F]  time = 0.065, size = 0, normalized size = 0. \[ \int{\frac{ \left ( gx+f \right ) ^{n} \left ( ce{x}^{2}+2\,cdx+a \right ) }{ex+d}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d),x)

[Out]

int((g*x+f)^n*(c*e*x^2+2*c*d*x+a)/(e*x+d),x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (c e x^{2} + 2 \, c d x + a\right )}{\left (g x + f\right )}^{n}}{e x + d}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d),x, algorithm="maxima")

[Out]

integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d), x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{{\left (c e x^{2} + 2 \, c d x + a\right )}{\left (g x + f\right )}^{n}}{e x + d}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d),x, algorithm="fricas")

[Out]

integral((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d), x)

_______________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{\left (f + g x\right )^{n} \left (a + 2 c d x + c e x^{2}\right )}{d + e x}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((g*x+f)**n*(c*e*x**2+2*c*d*x+a)/(e*x+d),x)

[Out]

Integral((f + g*x)**n*(a + 2*c*d*x + c*e*x**2)/(d + e*x), x)

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (c e x^{2} + 2 \, c d x + a\right )}{\left (g x + f\right )}^{n}}{e x + d}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d),x, algorithm="giac")

[Out]

integrate((c*e*x^2 + 2*c*d*x + a)*(g*x + f)^n/(e*x + d), x)